package com.lo23.data.objpicture;

import java.math.BigInteger;

import com.lo23.data.utils.DataUtils;
import com.lo23.data.xml.XMLData;

public class Mark {

	private XMLData.XMLPicture.XMLMarkItems _mark;

	public Mark(XMLData.XMLPicture.XMLMarkItems mark) {
		this._mark = mark;
	}

	/**
	 * Get the mark of the picture
	 * 
	 * @return the value
	 */
	public int getValue() {
		if(_mark.getValue() == null)
		{
			return -1;
		}else{
			return _mark.getValue().intValue();
		}
	}

	/**
	 * Get the ID of the author
	 * 
	 * @return the uID
	 */
	public String getAuthorID() {
		return DataUtils.nullString(_mark.getAuthor());
	}

	/**
	 * Set the mark of the picture
	 * 
	 * @param value
	 *            the value to set
	 */
	public void setValue(int value) {
		_mark.setValue(BigInteger.valueOf(value));
	}

	/**
	 * Set the ID of the author
	 * 
	 * @param author
	 *            the author ID to set
	 */
	public void setAuthorID(String author) {
		_mark.setAuthor(author);
	}

}
